# 已知, 局域网的IP 都是: 192.168.0.xxx
# 写程序，生成 从 192.168.0.1 ~ 192.168.0.254
# 区间的 254 个 IP 地址

# 方法2
ip_fmt2 = '192.168.0.{}'
x = 1
while x <= 254:
    # print(x)  # 1 2 3 4 .... 254
    ip = ip_fmt2.format(x)
    print(ip)
    x += 1



# 方法1
# ip_fmt = '192.168.0.%d'
# x = 1
# while x <= 254:
#     # print(x)  # 1 2 3 4 .... 254
#     ip = ip_fmt % x
#     print(ip)
#     x += 1

